package com.shilin.watchsystem.exception;

import com.shilin.watchsystem.enums.ResultEnum;



/**
 * 全局异常类
 */
public class AppException extends RuntimeException {

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public AppException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public AppException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }
}
